package com.exchange.dto;

import com.exchange.entity.ExchangeCodeProduct;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class ExchangeCodeProductDto {
    private Long id;
    private Long exchangeCodeId;
    private Long productId;
    private Integer quantity;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
    
    public static ExchangeCodeProductDto fromEntity(ExchangeCodeProduct exchangeCodeProduct) {
        ExchangeCodeProductDto dto = new ExchangeCodeProductDto();
        dto.setId(exchangeCodeProduct.getId());
        dto.setExchangeCodeId(exchangeCodeProduct.getExchangeCodeId());
        dto.setProductId(exchangeCodeProduct.getProductId());
        dto.setQuantity(exchangeCodeProduct.getQuantity());
        dto.setCreatedAt(exchangeCodeProduct.getCreatedAt());
        dto.setUpdatedAt(exchangeCodeProduct.getUpdatedAt());
        return dto;
    }
}